package com.edu.chapter06;

import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
import android.util.Log;

public class MyService1 extends Service {
    public static final String TAG = "MyService1";
    private final LocalBinder localBinder = new LocalBinder();

    public MyService1() {
    }

    @Override
    public IBinder onBind(Intent intent) {
        Log.d(TAG, "onBind");
        return localBinder;
    }

    public class LocalBinder extends Binder {
        MyService1 getService() {
            return MyService1.this;
        }
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        Log.d(TAG, "onDestroy");
    }

    public void dump() {
        Log.d(TAG, "dump");
    }
}